﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

using Chapter26.BasicWebClient;
using Chapter26.Browser;
using Chapter26.DnsLookup;
using Chapter26.TcpSendWithReceive;
using Chapter26.Socket;

namespace Chapter26
{
    /// <summary>
    /// MainWindow.xaml 的交互逻辑
    /// </summary>
    public partial class MainWindow : Window
    {
        public MainWindow()
        {
            InitializeComponent();
        }

        private void basicWebClientSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new BasicWebClientWindow();
            sampleWindow.ShowDialog();
        }

        private void openWriteSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new OpenWriteWindow();
            sampleWindow.ShowDialog();
        }

        private void UploadSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new UploadFileWindow();
            sampleWindow.ShowDialog();
        }

        private void reqResSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new WebRequestWithWebResponseWindow();
            sampleWindow.ShowDialog();
        }

        private void downloadFileSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new DownloadFileWindow();
            sampleWindow.ShowDialog();
        }

        private void ResponseHeaderSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new WebHeaderWindow();
            sampleWindow.ShowDialog();
        }

        private void credentialsSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var smapleWindow = new CredentialsWindow();
            smapleWindow.ShowDialog();
        }

        private void proxySampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new WebProxyWindow();
            sampleWindow.ShowDialog();
        }

        private void asyncRequestSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new AsyncRequestWindow();
            sampleWindow.ShowDialog();
        }

        private void webBrowserSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new WebBrowserWindow();
            sampleWindow.ShowDialog();
        }

        private void webBrowserHyperlinkSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new HyperlinkWetSiteWindow();
            sampleWindow.ShowDialog();
        }

        private void moreWebBrowserActionSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new MoreWebBrowserActionWindow();
            sampleWindow.ShowDialog();
        }

        private void webBrowserPrintSampleButton_Click(object sender, RoutedEventArgs e)
        {

        }

        private void displayWebBrowserCodingSampleButton_Click(object sender, RoutedEventArgs e)
        {

        }

        private void URISampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new UriWithUriBuilderWindow();
            sampleWindow.ShowDialog();
        }

        private void IPSampleButton_Click(object sender, RoutedEventArgs e)
        {
            
        }

        private void DnsLookupSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleWindow = new DnsLookupWindow();
            sampleWindow.ShowDialog();
        }

        private void tcpSendWitnReceiveSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleReceiveWindow = new TcpReceiveWindow();
            sampleReceiveWindow.Show();
            var sampleWindow = new TcpSendWindow();
            sampleWindow.Show();
        }

        private void SocketSendWitnReceiveSampleButton_Click(object sender, RoutedEventArgs e)
        {
            var sampleSocketReceiveWindow = new SocketReceiveWindow();
            sampleSocketReceiveWindow.Show();
            var sampleSocketSendWindow = new SocketSendWindow();
            sampleSocketSendWindow.Show();
        }
    }
}
